<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include("include/header.php"); ?>
<title><?php echo $post->title; ?> | <?php echo $this->setting->blogname; ?></title>
<link href="<?php echo $this->setting->static; ?>/css/page.css" rel="stylesheet" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="<?php echo $post->title; ?> &raquo; 评论 Feed" href="<?php echo $this->url('post', $post->ID); ?>/feed" />
<script type="text/javascript" src="<?php echo $this->setting->static; ?>/js/comment.js"></script>
<script type="text/javascript" src="<?php echo $this->setting->static; ?>/js/dpsh.js"></script>	
<script type="text/javascript" src="<?php echo $this->setting->static; ?>/js/tshare-qq.js"></script>	
<script type="text/javascript">
$(document).ready(function(){
	Comment.PostID = '<?php echo $post->ID; ?>';
	Comment.URL = '<?php echo $this->url('post',$post->ID);?>';
	Comment.Id = 'comment';
	Comment.Load();
	_share_tencent_weibo();
});
</script>
</head>

<body>
<?php include("include/banner.php"); ?>
<?php $author = $this->cache->get_author_detail($post->author); ?>
<div id="container">
	<div id="blog">
		<div id="content">
			<div id="main">
				<div id="main-content">
					<h1 class="title"><?php echo $post->title; ?></h1>
					<div class="clear"></div>
					<ul class="post" id="post-<?php echo $post->ID; ?>">
						<?php if($post->thumbnail!='') {?>
						<li class="gallery"><img src="<?php echo $post->thumbnail; ?>" /></li>
						<?php } ?>
						<li class="meta">
							发表于 <a href="<?php echo $this->url('date', $post->date); ?>"><?php echo date('Y/m/d',$post->time); ?></a> <?php echo date('H:i',$post->time); ?>
							作者 <a href="<?php echo $this->url('author', $author->nicename); ?>" title="查看 <?php echo $author->display_name; ?> 的所有帖子"><?php echo $author->display_name; ?></a>
							[<a href="#back" onclick="javascript:history.back();">返回</a>]
						</li>
						<li class="content">
							<div class="text post-text" id="content-<?php echo $post->ID; ?>">
							<?php
								if($post->password=='' || $this->check_post_password($post->ID)) {
									echo $post->content;
								} else {
									include("include/password.php");
								}
							?>
							</div>
							<ul class="pn">
								<li><?php if(!empty($post->previous)) echo "<a href=\"".$post->previous->url."\" title=\"".$post->previous->title."\">上一篇:『".$post->previous->title."』</a>"; else echo "<span>已经是第一篇了</span>"; ?></li>
								<li class="r"><?php if(!empty($post->next)) echo "<a href=\"".$post->next->url."\" title=\"".$post->next->title."\">下一篇:『".$post->next->title."』</a>"; else echo "<span>已经是最后一篇了</span>"; ?></li>
							</ul>
							<div class="clear"></div>
						</li>
						<li class="meta meta1">
							<span class="cat">分类: </span>
							<?php foreach((array)$this->cache->get_term_by_id($post->ID, 'category') as $category) {
								echo "<a href=\"".$this->url('category', $category->ID)."\" title=\"查看 ".$category->name." 中的全部文章\">";
								echo $category->name;
								echo "</a>&nbsp;"; 
							} ?>
							<span class="sep">|</span>
							<span class="tag">标签:</span> 
							<?php foreach((array)$this->cache->get_term_by_id($post->ID, 'post_tag') as $tag) {
								echo "<a href=\"".$this->url('post_tag', $tag->ID)."\">";
								echo $tag->name;
								echo "</a>&nbsp;"; 
							} ?>
							<?php if($post->comment_status=='open'){ ?>
							<span class="sep">|</span>
							<span class="tag">评论:</span> 
							<a href="#respond" title="我要发表评论">(<?php echo $post->comment; ?>)</a>
							<?php } ?>
							<?php if($this->logged_user->ID == $post->author) {?>
							<span class="sep">|</span>
							<a href="<?php echo str_replace('%post_id%', $post->ID, $this->config->WP_URL['edit_post']); ?>">编辑</a>
							<?php } ?>
						</li>
					</ul>
					<div class="clear"></div>
					<?php include("include/comment.php"); ?>
					<div class="paged paged1">&nbsp;</div>
				</div>
			</div>
			
			<!-- side bar -->
			<div id="side">
				<?php include("include/sidebar.php"); ?>
			</div>
			
			<div class="clear h25"></div>
		</div>
		<div class="clear"></div>
	</div>	
</div>
<?php include("include/footer.php"); ?>
</body>
</html>